import { BasicFetchResult, SaaSPageParams } from '/@/api/model/baseModel';

export type TaskQueryParams = {
  appId: string;
  tenantCode: string;
  size: number;
  current: number;
};

export type TaskPageQueryParams = TaskQueryParams & SaaSPageParams;

export interface JobInfo {
  id: string;
  name: string;
  type: string;
  description: string;
  quartzJobClassName: string;
  quartzStatus: string;
  duration: string;
  appId: string;
  appName: string;
  componentId: string;
  componentName: string;
  imageId: string;
  image: string;
  instanceId: string;
  instanceType: string;
  tenantCode: string;
  tenantName: string;
  jobGroup: string;
  oldJobName: string;
  oldJobGroup: string;
  messageId: string;
  errorMsg: string;
  cceNamespcae: string;
  cceDeployment: string;
  cceService: string;
  cseAppName: string;
  cseServiceName: string;
  cseConfigsId: string;
  dbMultiTenantMode: string;
  appMultiTenantMode: string;
}

export type DeployTaskListResultModel = BasicFetchResult<JobInfo>;

export type taskParams = {
  deployTask?: string;
};

export interface deployTaskListItem {
  deployTask?: string; //部署任务
  application?: string; //应用
  enterpriseName?: string; //企业名称
  category?: string; //套餐类型
  component?: string; //组件
  status?: string; //状态
  latelyTime: string; //最近一次执行开始时间
  duration?: string; //时长
  executor?: string; //执行者
  description?: string;
}

export type DeployListGetResultModel = BasicFetchResult<deployTaskListItem>;

// 请求参数：任务重跑
export type DeployTaskRollBackParams = {
  id: string;
  type: string;
};
export type RenewalAppParams = {
  tenantCode: string;
  appId: string;
  renewDuration: number;
};
